﻿#ifndef MUSICWINDOW_H
#define MUSICWINDOW_H

#include <QMainWindow>
#include <QStandardItemModel>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QMediaPlayer>
#include <QMediaPlaylist>
#include <QVector>
#include <QMovie>
#include <QHeaderView>
#include "mysql.h"
namespace Ui {
class musicWindow;
}

struct songInfo
{
public:
    QString singer;
    QString song;
    QString duration;
    int id;
    songInfo(QString s1,QString s2,QString d1,int i1)
    {
        singer=s1;
        song=s2;
        duration=d1;
        id=i1;
    }
};

class musicWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit musicWindow(QWidget *parent = nullptr);
     void  backWidget(QWidget *parent);
     void  parseJson(QByteArray json);
    ~musicWindow();
private slots:
     void on_net_finish(QNetworkReply *reply);
     //void on_net_2_finished(QNetworkReply *reply);
     void on_pushButton_clicked();

     void on_tableView_doubleClicked(const QModelIndex &index);

     void on_pushButton_2_clicked();

     void on_pushButton_3_clicked();

     void on_pushButton_5_clicked();

     void on_pushButton_4_clicked();
     void on_slider_duration(int duration);
     void on_slider_postion(int position);

     void on_horizontalSlider_sliderReleased();

     void on_tableView_clicked(const QModelIndex &index);

     void on_pushButton_6_clicked();

     void on_pushButton_7_clicked();

     void on_pushButton_8_clicked();

private:
    Ui::musicWindow *ui;
    QWidget *back;
    QNetworkAccessManager *net;
    //QNetworkAccessManager *net_2;
    QStandardItemModel *mod1;
    QMediaPlayer *player;
    QMediaPlaylist *play_list;
    mySql *sql;
    int clicks=0;
    int dangqu=0;
    int listcycle=0;
};

#endif // MUSICWINDOW_H
